package com.mall4j.cloud.product.service.impl;

import com.mall4j.cloud.product.mapper.CategoryBrandMapper;
import com.mall4j.cloud.product.model.CategoryBrand;
import com.mall4j.cloud.product.service.CategoryBrandService;
import com.mall4j.cloud.product.vo.CategoryBrandVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 品牌与分类相关联
 *
 * @author JCM
 * @date 2021-04-24 21:02:00
 */
@Service
public class CategoryBrandServiceImpl implements CategoryBrandService {

    @Autowired
    private CategoryBrandMapper categoryBrandMapper;

    @Override
    public List<CategoryBrandVO> getByCategoryId(Long categoryId) {
        return categoryBrandMapper.getByCategoryId(categoryId);
    }

    @Override
    public void save(CategoryBrand categoryBrand) {
        categoryBrandMapper.save(categoryBrand);
    }

    @Override
    public void deleteByBrandId(Long brandId) {
        categoryBrandMapper.deleteByBrandId(brandId);
    }
}
